home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 11 / PCPP11.iso / utils / frogbit / fb-097.exe / MAKE CSV.FB < prev    next >
Encoding:
Text File  |  1997-02-04  |  550 b   |  22 lines

  1.  
  2. // Extract comma-delimited data from a report
  3.  
  4. input "tests.prn"
  5.  
  6. do while (someLeft input)
  7.   skip lines until (line matches "~Results for ~(month) ~(year)")
  8.   skip lines until (line contains "-----")
  9.   do while (someLeft(input))
  10.     read
  11.     leave if (line contains "-----")
  12.     error if (not (line matches "| ~(ages) | ~(test) | ~(result) |")) "unrecognised line"
  13.     write (year "," month "," ages "," test "," result)
  14.   loop
  15.  
  16.   // comment out the next line to make the program run faster
  17.   refresh
  18.  
  19. loop
  20.  
  21. output "tests.csv"
  22.